﻿using ModernUILogViewer.Settings;
using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Text;
using System.Windows.Data;
using System.Windows.Media;

namespace ModernUILogViewer.Converters
{
    [ValueConversion(typeof(string), typeof(Color))]  
    class ColorConverter : IValueConverter
    {
        public object Convert(object value, Type TargetType, object parameter, CultureInfo culture)
        {
            string color = (value != null ? value : parameter).ToString();
            return System.Windows.Media.ColorConverter.ConvertFromString(color);
        }

        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
        {
            return new NotImplementedException();
        }    
    }
}
